package com.lht.designPattern.observer;

import java.util.Observable;
import java.util.Observer;

/**
 * <p>
 *     学生，观察者，观察 铃声
 * </p>
 * @author Eric
 * @version 1.0
 * @date 2019-06-13
 */
public class Student implements Observer {

    private String name;

    public Student(){
        this(null);
    }

    public Student(String name) {
        this.name = name;
    }

    @Override
    public void update(Observable o, Object arg) {
        System.out.println(name+"听到打铃了，回教室了");
    }
}
